<?php
class Zendvn_View_Helper_ZenjooHeadJs extends Zend_View_Helper_Abstract{
    
    public function zenjooHeadJs($input = null,$idClass =null){
    	switch ($input){
    		case "behavior.jquery":
    			$path[] = PUBLIC_URL."/js/jquery-1.7.1.js";
    			break;
    		case "behavior.accordion":
    			$path[] = PUBLIC_URL."/js/ui/jquery.ui.core.js";
    			$path[] = PUBLIC_URL."/js/ui/jquery.ui.widget.js";
    			$path[] = PUBLIC_URL."/js/ui/jquery.ui.accordion.js";
    			$script ='$(function() {
								$( "'.$idClass.'" ).accordion({
									collapsible: true,
								});
							});';
    			break;
    		case "behavior.datepicker":
    			$path[] = PUBLIC_URL."/js/ui/jquery.ui.core.js";
    			$path[] = PUBLIC_URL."/js/ui/jquery.ui.widget.js";
    			$path[] = PUBLIC_URL."/js/ui/jquery.ui.datepicker.js";
    			$script ='$(function() {
							$( "'.$idClass.'" ).datepicker({
								showOn: "button",
								buttonImage: "'.PUBLIC_URL.'/js/themes/base/images/calendar.png'.'" ,
								buttonImageOnly: true
							});
						});';
				$this->view->headLink()->appendStylesheet(PUBLIC_URL.'/js/themes/base/jquery.ui.all.css');
    			break;
    			
    	}
    	foreach ($path as $file) $this->view->headScript()->appendFile($file);
    	$this->view->headScript()->appendScript($script);
        return false;
    }
}
        